package com.example.cognitivesystemserver.controller;

import com.example.cognitivesystemserver.pojo.Evaluation;
import com.example.cognitivesystemserver.pojo.StudyResource;
import com.example.cognitivesystemserver.pojo.WarringResult;
import com.example.cognitivesystemserver.pojo.WorkInfo;
import com.example.cognitivesystemserver.service.RecommendationService;
import com.example.cognitivesystemserver.service.StudentService;
import com.example.cognitivesystemserver.service.WarringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
public class RecommendationController {
    @Autowired
    private RecommendationService recommendationService;
//    private Evaluation evaluation;
//    @Autowired
//    private StudentService studentService;
//    @Autowired
//    private WarringService warringService;
//    private WorkInfo workInfo;
    //工作推荐
    @GetMapping("/Rec/workRec")
    public Object workRecommendation(String needed){
        ModelAndView modelAndView=new ModelAndView();
        WorkInfo workInfo = recommendationService.workRecommendation(needed);
        modelAndView.addObject("workInfo", workInfo);
        modelAndView.setViewName("workInfo");
        return workInfo;
    }

    //学习资料推荐
    @GetMapping("/Rec/studyRec")
    public Object studyRecommendation(String src) {
        ModelAndView modelAndView=new ModelAndView();
        StudyResource StudyResource = recommendationService.studyRecommendation(src);
        modelAndView.addObject("StudyResource",StudyResource);
        modelAndView.setViewName("StudyResource");
        return StudyResource;
    }
    //学习计划推荐
    @GetMapping("/Rec/studyPlan")
    public Object studyPlan(){
//        //1.需要当前能力评估结果结合算法进行分析。
//        Double efficiency = evaluation.getEfficiency();
//        Double avgScore = evaluation.getAvgScore();
//        Double speed = evaluation.getSpeed();
//        //2.需要当前学习状况，课程得分
//        List<Score> allStuScore = studentService.getAllStuScore();
//        //3.需要预警结果
//        List<WarringResult> allWarring = warringService.getAllWarring();
//        //4.需要工作意向
//        System.out.println("需要工作意向");
//        //5.需要公司需求
//        String needed = workInfo.getNeeded();

        return "studyPlan";
    }
}
